﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Web.Mvc;
using SimpComm;


namespace DAL.Enums
{

    #region 用户面试状态
    /// <summary>
    /// 用户面试状态
    /// </summary>
    public class emUser_Face_Result_State : MyEnum<byte>
    {
        public static readonly emUser_Face_Result_State All = new emUser_Face_Result_State(255, "所有状态");
        public static readonly emUser_Face_Result_State Selected = new emUser_Face_Result_State(0, "请选择状态");
        public static readonly emUser_Face_Result_State FaceResultSucc = new emUser_Face_Result_State(1, "面试成功");
        public static readonly emUser_Face_Result_State FaceResultFair = new emUser_Face_Result_State(2, "面试失败");
        public static readonly emUser_Face_Result_State FaceResultQuit = new emUser_Face_Result_State(3, "拒绝入职");


        /// <summary>
        /// 自动生成List
        /// </summary>
        private static List<emUser_Face_Result_State> _Items;
        public static List<emUser_Face_Result_State> Items
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Face_Result_State)field.GetValue(null)).ToList();
                }
                return _Items;
            }
        }
        public static JsonResult Get_JsonResult
        {
            get { return new JsonResult() { Data = Items, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
        }

        public static List<MyEnum<byte>> BaseItems
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Face_Result_State)field.GetValue(null)).ToList();
                }
                return _Items.Select(p => p as MyEnum<byte>).ToList();
            }
        }
        public static emUser_Face_Result_State Get(byte value)
        {
            return Items.SingleOrDefault(p => p.Value == value);
        }

        public static emUser_Face_Result_State Get(string text)
        {
            var data = Items.SingleOrDefault(p => p.Text == text);
            if (data != null)
            {
                return data;
            }
            else
            {
                var i = Commons.ConvertHelper.ObjToIntNull(text);
                if (i.HasValue)
                    return Get((byte)i.Value);
            }
            return null;
        }

        //私有构造函数,有效阻止在类型外部生成实例
        private emUser_Face_Result_State(byte value, string text)
        {
            _Value = value;
            _Text = text;
        }
    }
    #endregion

    #region 用户面试印象
    /// <summary>
    /// 用户面试印象
    /// </summary>
    public class emUser_Face_Impression : MyEnum<byte>
    {
        public static readonly emUser_Face_Impression All = new emUser_Face_Impression(255, "所有状态");
        public static readonly emUser_Face_Impression Selected = new emUser_Face_Impression(0, "请选择");
        public static readonly emUser_Face_Impression VeryBad = new emUser_Face_Impression(1, "很差");
        public static readonly emUser_Face_Impression SosoBad = new emUser_Face_Impression(2, "差");
        public static readonly emUser_Face_Impression Soso = new emUser_Face_Impression(3, "一般");
        public static readonly emUser_Face_Impression SosoGood = new emUser_Face_Impression(4, "好");
        public static readonly emUser_Face_Impression VeryGood = new emUser_Face_Impression(5, "非常好");


        /// <summary>
        /// 自动生成List
        /// </summary>
        private static List<emUser_Face_Impression> _Items;
        public static List<emUser_Face_Impression> Items
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Face_Impression)field.GetValue(null)).ToList();
                }
                return _Items;
            }
        }
        public static JsonResult Get_JsonResult
        {
            get { return new JsonResult() { Data = Items, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
        }

        public static List<MyEnum<byte>> BaseItems
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Face_Impression)field.GetValue(null)).ToList();
                }
                return _Items.Select(p => p as MyEnum<byte>).ToList();
            }
        }
        public static emUser_Face_Impression Get(byte value)
        {
            return Items.SingleOrDefault(p => p.Value == value);
        }

        public static emUser_Face_Impression Get(string text)
        {
            var data = Items.SingleOrDefault(p => p.Text == text);
            if (data != null)
            {
                return data;
            }
            else
            {
                var i = Commons.ConvertHelper.ObjToIntNull(text);
                if (i.HasValue)
                    return Get((byte)i.Value);
            }
            return null;
        }

        //私有构造函数,有效阻止在类型外部生成实例
        private emUser_Face_Impression(byte value, string text)
        {
            _Value = value;
            _Text = text;
        }
    }
    #endregion

    #region 用户面试途径
    /// <summary>
    /// 用户面试途径
    /// </summary>
    public class emUser_Face_PathWay : MyEnum<byte>
    {
        public static readonly emUser_Face_PathWay All = new emUser_Face_PathWay(255, "所有状态");
        public static readonly emUser_Face_PathWay Selected = new emUser_Face_PathWay(0, "请选择");
        public static readonly emUser_Face_PathWay ByOnline = new emUser_Face_PathWay(1, "网络招聘");
        public static readonly emUser_Face_PathWay ByTV = new emUser_Face_PathWay(2, "电视招聘");
        public static readonly emUser_Face_PathWay ByPaper = new emUser_Face_PathWay(3, "报纸招聘");
        public static readonly emUser_Face_PathWay ByMagazine = new emUser_Face_PathWay(4, "刊物招聘");
        public static readonly emUser_Face_PathWay Other = new emUser_Face_PathWay(9, "其他");


        /// <summary>
        /// 自动生成List
        /// </summary>
        private static List<emUser_Face_PathWay> _Items;
        public static List<emUser_Face_PathWay> Items
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Face_PathWay)field.GetValue(null)).ToList();
                }
                return _Items;
            }
        }
        public static JsonResult Get_JsonResult
        {
            get { return new JsonResult() { Data = Items, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
        }

        public static List<MyEnum<byte>> BaseItems
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Face_PathWay)field.GetValue(null)).ToList();
                }
                return _Items.Select(p => p as MyEnum<byte>).ToList();
            }
        }
        public static emUser_Face_PathWay Get(byte value)
        {
            return Items.SingleOrDefault(p => p.Value == value);
        }

        public static emUser_Face_PathWay Get(string text)
        {
            var data = Items.SingleOrDefault(p => p.Text == text);
            if (data != null)
            {
                return data;
            }
            else
            {
                var i = Commons.ConvertHelper.ObjToIntNull(text);
                if (i.HasValue)
                    return Get((byte)i.Value);
            }
            return null;
        }

        //私有构造函数,有效阻止在类型外部生成实例
        private emUser_Face_PathWay(byte value, string text)
        {
            _Value = value;
            _Text = text;
        }
    }
    #endregion

    #region 用户面试花费时间
    /// <summary>
    /// 用户面试花费时间/一个工作日8小时
    /// </summary>
    public class emUser_Face_WasteTime : MyEnum<byte>
    {
        public static readonly emUser_Face_WasteTime All = new emUser_Face_WasteTime(255, "所有状态");
        public static readonly emUser_Face_WasteTime Selected = new emUser_Face_WasteTime(0, "请选择");
        public static readonly emUser_Face_WasteTime t1 = new emUser_Face_WasteTime(1, "1小时");
        public static readonly emUser_Face_WasteTime t2 = new emUser_Face_WasteTime(2, "2小时");
        public static readonly emUser_Face_WasteTime t4 = new emUser_Face_WasteTime(4, "半天");
        public static readonly emUser_Face_WasteTime t8 = new emUser_Face_WasteTime(8, "一天");
        public static readonly emUser_Face_WasteTime t16 = new emUser_Face_WasteTime(16, "两天");
        public static readonly emUser_Face_WasteTime t56 = new emUser_Face_WasteTime(56, "一个星期");


        /// <summary>
        /// 自动生成List
        /// </summary>
        private static List<emUser_Face_WasteTime> _Items;
        public static List<emUser_Face_WasteTime> Items
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Face_WasteTime)field.GetValue(null)).ToList();
                }
                return _Items;
            }
        }
        public static JsonResult Get_JsonResult
        {
            get { return new JsonResult() { Data = Items, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
        }

        public static List<MyEnum<byte>> BaseItems
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Face_WasteTime)field.GetValue(null)).ToList();
                }
                return _Items.Select(p => p as MyEnum<byte>).ToList();
            }
        }
        public static emUser_Face_WasteTime Get(byte value)
        {
            return Items.SingleOrDefault(p => p.Value == value);
        }

        public static emUser_Face_WasteTime Get(string text)
        {
            var data = Items.SingleOrDefault(p => p.Text == text);
            if (data != null)
            {
                return data;
            }
            else
            {
                var i = Commons.ConvertHelper.ObjToIntNull(text);
                if (i.HasValue)
                    return Get((byte)i.Value);
            }
            return null;
        }

        //私有构造函数,有效阻止在类型外部生成实例
        private emUser_Face_WasteTime(byte value, string text)
        {
            _Value = value;
            _Text = text;
        }
    }
    #endregion

    #region 用户面试过程
    /// <summary>
    /// 用户面试过程
    /// </summary>
    public class emUser_Face_Process : MyEnum<byte>
    {
        public static readonly emUser_Face_Process All = new emUser_Face_Process(255, "所有状态");
        public static readonly emUser_Face_Process Selected = new emUser_Face_Process(0, "请选择");
        public static readonly emUser_Face_Process FaceToFace = new emUser_Face_Process(1, "一对一面试");
        public static readonly emUser_Face_Process PeoplesFace = new emUser_Face_Process(2, "多对一面试");
        public static readonly emUser_Face_Process FirWrite = new emUser_Face_Process(3, "先笔试后面试");
        public static readonly emUser_Face_Process OnlyWrite = new emUser_Face_Process(4, "只笔试");
        public static readonly emUser_Face_Process Other = new emUser_Face_Process(9, "其他");


        /// <summary>
        /// 自动生成List
        /// </summary>
        private static List<emUser_Face_Process> _Items;
        public static List<emUser_Face_Process> Items
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Face_Process)field.GetValue(null)).ToList();
                }
                return _Items;
            }
        }
        public static JsonResult Get_JsonResult
        {
            get { return new JsonResult() { Data = Items, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
        }

        public static List<MyEnum<byte>> BaseItems
        {
            get
            {
                if (_Items == null)
                {
                    var _Type = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType;
                    _Items =
                        _Type.GetFields().Where(field => field.FieldType == _Type).Select(
                            field => (emUser_Face_Process)field.GetValue(null)).ToList();
                }
                return _Items.Select(p => p as MyEnum<byte>).ToList();
            }
        }
        public static emUser_Face_Process Get(byte value)
        {
            return Items.SingleOrDefault(p => p.Value == value);
        }

        public static emUser_Face_Process Get(string text)
        {
            var data = Items.SingleOrDefault(p => p.Text == text);
            if (data != null)
            {
                return data;
            }
            else
            {
                var i = Commons.ConvertHelper.ObjToIntNull(text);
                if (i.HasValue)
                    return Get((byte)i.Value);
            }
            return null;
        }

        //私有构造函数,有效阻止在类型外部生成实例
        private emUser_Face_Process(byte value, string text)
        {
            _Value = value;
            _Text = text;
        }
    }
    #endregion
}

